<include file="Public:header" />
<script type="text/javascript" src="__PUBLIC__/admin/js/engine.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/jq_validate.js"></script>
<script language="javascript" type="text/javascript" src="__PUBLIC__/admin/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(function(){	
    $('#title').validate('required','请填写广告名称').validate();
    $('#url').validate('required','请填网站地址').validate('url','地址不正确，请以http://开头').validate();
    $('#start_time').validate('required','开始时间不能为空').validate();
    $('#end_time').validate('required','结束时间不能为空').validate();
    $('#dataForm').submitValidate();
});
</script>
<body class="mainBackground">
	<include file="Public:menu" />
	<div class="main" id="mainContainer">
        <!--发布-->
    	<div class="content_box">
        	<div class="content_box_t">
            	<h3 class="fl">
               	<neq name="data[id]" value=''>
                编辑<else/>发布</neq>广告
                </h3>
            </div>
            <div class="content_box_c">
            	<form action="__ACTION__" method="post" id="dataForm" name="dataForm" enctype="multipart/form-data">
                    <div class="field">
                        <label>广告名称</label>
                        <input class="text_input medium_input" type="text" name="title" id="title" value="{$data.title}" />
                        <span class="input_notification  png_bg" id="titleTip"></span>
                        <small>必填</small>
                    </div>
                    <div class="field pt15">
                        <label>跳转地址</label>
                        <input class="text_input w20_input" type="text" name="url" id="url" value="{$data.url}" />
                        <span class="input_notification  png_bg" id="urlTip"></span>
                        <small>必填(以'http://'开头)</small>
                    </div>
                    <div class="field pt15">
                        <label>图片
                            <neq name="data['pic']" value="">(<a href="/uploadfile/ad/{$data.pic}" title="查看图片" target="_blank"  style="color:#F00;">查看图片</a>)</neq>
                        </label>
                        <input class="text_input medium_input" type="file" name="photo" id="photo"/>
                        <small>图片大小：{$currentPosition.width}px*{$currentPosition.height}px(图片格式：jpg,gif,png)</small>
                    </div> 
                    <div class="field pt15">
                        <label>开始时间</label>
                        <input class="text_input w20_input Wdate" type="text" id="start_time" name="start_time" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly"<notin name='data.start_time' value='0,'>value="{$data.start_time|date='Y-m-d h:m:s',###}"</notin>/><span class="input_notification  png_bg" id="start_timeTip"></span>
                        <small>必填</small>
                    </div>
                    <div class="field pt15">
                        <label>结束时间</label>
                        <input class="text_input w20_input Wdate" type="text" id="end_time" name="end_time" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" <notin name='data.end_time' value='0,'>value="{$data.end_time|date='Y-m-d h:m:s',###}"</notin>/><span class="input_notification  png_bg" id="end_timeTip"></span>
                        <small>必填</small>
                    </div>                                        
                    <div class="field pt15">
                        <label>其他说明</label>
                        <textarea class="text_input" name="content" id="content" cols="79" rows="5">{$data.content}</textarea>
                    </div>            
                	<div class="field pt15">
						<label>是否开放</label>
						<input type="checkbox" name="status"  value="1" <eq name="data.status" value="1"> checked</eq>/>是 
					</div>                                                                                                  
                    <div class="field pt15 clearfix">
                        <input type="hidden" name="position_id" value="{$currentPosition.id}"/> 
                        <input type="hidden" name="width" value="{$currentPosition.width}"/>
                        <input type="hidden" name="height" value="{$currentPosition.height}"/>  
                    	<input type="hidden" name="id" value="{$data.id}"/>   
                    	<input type="submit" value="提交" class="public_button fr" />
                    </div>                                                                               
                </form>
            </div>
        </div>            
        <!--发布结束-->
    </div>
</body>
</html>
